home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c++
- Subject: Re: IMPORTANT!!!!!!!!!!!!!!!!!!!!!
- Date: Fri, 02 Feb 1996 04:46:00 GMT
- Organization: Netcom
- Message-ID: <31118eca.8987840@nntp.ix.netcom.com>
- References: <4epb8s$9gp@reader2.ix.netcom.com> <311043bd.32347008@nntp.ix.netcom.com> <4er95j$5hh@cloner4.netcom.com>
- NNTP-Posting-Host: ix-dc7-19.ix.netcom.com
- X-NETCOM-Date: Thu Feb 01 8:46:40 PM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- jeremyx@ix.netcom.com(Jeremy Johnston ) wrote:
-
- > In <311043bd.32347008@nntp.ix.netcom.com> miker3@ix.netcom.com (Mike
- > Rubenstein) writes:
- > >
- > >jeremyx@ix.netcom.com(Jeremy Johnston ) wrote:
- > >
- > >>
- > >>
- > >>
- > >> For some reason i can never get the \ to print! How do you
- > get
- > >> the \ to show up on the screen when you run the program??
- > >>
- > >> ex:
- > >>
- > >>
- > >> printf(" i can never get the \ to print");
- > >> printf(" do you like dogs\cats?");
- > >>
- > >> after i compile the program & run it the "\" doesn'y show up?
- > >> please help!?
- > >>
- > >
- > >In C++ literal strings, \ is an escape character. You need something
- > >like
- > >
- > > printf(" i can never get the \\ to print");
- > > printf(" do you like dogs\\cats?");
- > >
- > >
- > >Michael M Rubenstein
- >
- > so your saying i just gotta make two of them & it will work?
-
- In a literal, yes. It's not a question of printing. If you just use
- one \, it never gets put into the string. If you put two adjacent \
- in a string literal, the resulting string contains 1 \.
-
-
- Michael M Rubenstein
-